package chapter_9.wait;

public class Input implements Runnable{

    private Resource resource;

    public Input(Resource resource){
        this.resource=resource;
    }

    @Override
    public void run() {
        int count = 0;
        while(true){
            if(count == 0){
                resource.set("张三",1);
            }else{
                resource.set("李四",0);
            }
            count = (count+1) % 2;
        }
    }
}
